"""redis测试脚本"""
import time

import redis

r = redis.Redis(host="localhost", port=6379, db=0,
                charset="utf8", decode_responses=True)
# from MxOnline.settings import REDIS_HOST, REDIS_PORT

r.set("name", "Frank")
r.expire("name", 1)  # 设置10s过期
# time.sleep(1)
print(r.get("name"))  # Frank
